<!DOCTYPE HTML><html>
<head>
<? echo $h->meta($title, $kwd, $dpn); ?>
<? require_once("lib.php"); ?>
<script src="<?=$ecom?>/js/jquery.validate.js" type="text/javascript"></script>
<script src="<?=$ecom?>/js/jquery.metadata.js" type="text/javascript"></script>

</head>
<body id="">
<? include_once("header.php"); ?>
<div id="wrap">
	<div class="breadcrumb">
		<a href="./"><?=WEB_INDEX_PAGE?></a> &gt; <a href="member.html"><?=WEB_MEMBER_CENTER?></a> &gt; <span><?=$cate_name?></span>
	</div><!--breadcrumb end-->
	<div id="" class="w180 left">
		<? require 'member_menu.php' ?>
	</div><!--. w220-->
		<div id="" class="right w760">
			<div class="">
				<div class="h2news">
					<h2><?=$cate_name?></h2>
				</div>
				<div class="myorder">
				<? if($do=='add'){ ?>
					<div class="review_add">
						<div class="px20"></div>
						<strong class="font14px"> &nbsp; <?=$product_name?></strong>
						<p class="gray line15"> &nbsp; <?=WEB_PURCHASED_TIME?>: <?=$tem['created_time']?></p>
						<div class="px20"></div>
						<form action="myreview.php" method="post" class="need_check">
							<input type="hidden" name="action" value="insert" />
							<input type="hidden" name="sales_order_detail_id" value="<?=$id?>" />
							<table>
								<tr><td width="48" class="tright"><?=WEB_RATING?>: </td><td>
									<div class="pro_rating">
									<ul class="rating nostar">
										<li class="one"><a href="#" title="1 star">1</a></li>
										<li class="two"><a href="#" title="2 star">2</a></li>
										<li class="three"><a href="#" title="3 star">3</a></li>
										<li class="four"><a href="#" title="4 star">4</a></li>
										<li class="five"><a href="#" title="5 star">5</a></li>
									</ul>
								</div>
									<input type="hidden" class="rating" name="rating" value="5" /></td></tr>
								<tr><td class="tright"><span class="error">*</span> <?=WEB_CONTENT?>: </td><td><textarea placeholder="<?=WEB_LEAVE_SOME_COMMENT?>" class="g  {validate:{required:true,messages:{required:' <?=WEB_CONTENT_REQUIRED?>.'}}}" name="content" cols="24" rows="5"></textarea></td></tr>
								<tr><td>&nbsp;</td><td><input class="button_blue" type="submit" value="<?=WEB_SUBMIT?>" /> &nbsp; <a href="myreview.php" class="orange"><?=WEB_CANCEL?></a></td></tr>
							</table>
						</form>
					</div>
				<? } else { ?>
					<div class="order_list">
						<table width="100%" class=" review_list">
							<tr class="order_list_h tcenter"><td class="l" width="160"><?=WEB_ORDER_REFERENCE?></td><td width=""><?=WEB_PRODUCT_NAME?></td><td width=""><?=WEB_PURCHASED_TIME?></td><td width=""><?=WEB_COMMENT?></td></tr>
						<?
							$str=''; $k=0;
							foreach($info as $val){
								$order_id=$val['sales_order_id'];
								$order_code=$arr_order[$val['sales_order_id']]['ref_no'];
								// 订单状态, 重要
								$order_status=$arr_order[$val['sales_order_id']]['order_status'];

								$product_name=$arr_product[$val['product_id']]['name_'.$lang];
								if(isset($val['review'])) $review=$val['review']['content'];
								// 已交付但未评论
								elseif($order_status==5) $review='<a href="myreview.php?do=add&id='.$val['id'].'" class="button_blue">'.WEB_GO_TO_REVIEW.'</a>';
								//其余状态不能评论
								else $review='<span class="gray">'.WEB_ALLOW_REVIEW_ONLY_AFTER_RECEIVED.'</span>';
								// 取消过的订单不显示
								if($order_status < 7)$str.='
							<tr><td width="" class="l tcenter">
								<a href="old_order.php?code='.$order_code.'" class="blue">'.$order_code.'</a>
							</td><td>'.$product_name.'</td><td width="" class="tcenter">'.$val['created_time'].'</td><td width="160" class="tcenter">'.$review.'</td></tr>';
								}
							$str.='';
							$k++;
							echo $str;
						?>
					</table>
					</div>
					<? echo echo_page($page, $pages, $url.'-p',$lang_id); ?>
					<? } ?>
				</div>
				<div class="clear"></div>
			</div><!--. featured product-->
	</div><!--# featured_and_ad_right-->
		<div class="clear"></div>
	<div class="px20"></div>
	<div class="clear"></div>
</div>
<? include("footer.php"); ?>
<script type="text/javascript">
  $(document).ready(function(){
  	$(".need_check").validate({meta: "validate", onkeyup: false,
		errorPlacement: function( label, element ) {
			element.parent().append("<br>").append(label);
		}
	
	});
});
</script>
</body>
</html>